package ru.ifmo.common.util;

import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
import java.util.Random;

/**
 * @author avhaliullin
 */
public class RandomUtil {
    public static List<Integer> combination(int n, int k, Random rnd) {
        LinkedList<Integer> list = new LinkedList<Integer>();
        for (int i = 0; i < n; i++) {
            list.add(i);
        }
        Collections.shuffle(list, rnd);
        return list.subList(0, k);
    }
}
